<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div id="myDom" v-if="visible"> v-if</div>
        <button @click="getMyDom"> 切换显示</button>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
    <script>
        new Vue({
            el:'#app',
            data:{
               visible:false 
            },
            methods:{
                getMyDom(){
                    this.visible=!this.visible;
                    Vue.nextTick().then(function(){
                        console.log(document.getElementById('myDom'));
                    })
                }
            }
        })
    </script>
</body>
</html>